package com.fomky.queried.service.query.service;

import com.fomky.queried.common.connect.RowDataList;
import com.fomky.queried.common.entity.QueryRequest;
import com.fomky.queried.plugin.common.ConnectPlugin;
import com.fomky.queried.service.connect.ConnectManager;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

@Service
public class QueryService {

    @Resource
    private ConnectManager connectManager;


    public RowDataList queryRequest(QueryRequest request) {
        ConnectPlugin plugin = connectManager.findAndCreateConnect(request.getConnectId(), request.getConnect());
        // TODO CHECK connectPlugin
        return plugin.executeRoute(request);
    }
}
